home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vqstrg / vqshell.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  3.0 KB  |  82 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3750
  5.    ClientLeft      =   1080
  6.    ClientTop       =   1965
  7.    ClientWidth     =   7365
  8.    Height          =   4155
  9.    Left            =   1020
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3750
  13.    ScaleWidth      =   7365
  14.    Top             =   1620
  15.    Width           =   7485
  16. Sub Form_Load ()
  17. On Error GoTo FormLoadError
  18. CR$ = Chr$(13) + Chr$(10)
  19. '------ Remove the message box call below and insert your own code.
  20. Msg$ = "This is a quick start shell for VqString array functions." + CR$
  21. Msg$ = Msg$ + "See the Form Load procedure for example code."
  22. MsgBox Msg$, 64, "VqStrings"
  23. '******** Initialize variable length VqString array ********
  24. '------ To use variable length VqString array, set the values
  25. '------ of Elements And BufSize And un-comment the
  26. '------ initialization call below.
  27. 'x& = VqVarLenStr(Test, 1, Elements, Bufsize)
  28. '******** Initialize fixed length VqString array ********
  29. '------ To use fixed length VqString array, set the values
  30. '------ of Elements And BufSize And un-comment the
  31. '------ initialization call below.
  32. 'x& = VqFixLenStr(Test, 1, Elements, StrSize)
  33. '------ Example call to store a string in a variable length VqString array.
  34. 'If VqPutVarString(Test, Handle%, Element&) < 0 Then Error Abs(VqError)
  35. '------ Example call to get a string from a variable length VqString array.
  36. 'If VqGetVarString(Test, Handle%, Element&) < 0 Then Error Abs(VqError)
  37. '------ Example call to store a string in a fixed length VqString array.
  38. 'If VqFixLenStr(Test, Handle%, Element&, VqPutString) < 0 Then Error Abs(VqError)
  39. '------ Example call to get a string from a fixed length VqString array.
  40. 'If VqFixLenStr(Test, Handle%, Element&, VqGetString) < 0 Then Error Abs(VqError)
  41. '******** Erase VqString arrays ********
  42. '------ After using VqString array, un-comment the appropriate
  43. '------ erase call.
  44. 'x& = VqFixLenStr(Test, 1, 0, VqEraseString)
  45. 'x& = VqVarLenStr(Test, 1, 0, VqEraseString)
  46. FormLoadError:
  47. MsgBox Error$, 0, "Error"
  48. End Sub
  49. Function VqGetVarString (Strng$, Handle%, Page&)
  50. 'Support function to get string from variable length
  51. ' VqString array.
  52. x% = VqVarLenStr(Strng$, Handle%, Page&, VqVarGetSize)
  53. If x% < 0 Then
  54.     VqGetVarString = x%
  55.     VqError = x%
  56.     Exit Function
  57. End If
  58. Strng$ = Space$(x%)
  59. x% = VqVarLenStr(Strng$, Handle%, Page&, VqGetString)
  60. If x% < 0 Then
  61.     VqGetVarString = x%
  62.     VqError = x%
  63.     Exit Function
  64. End If
  65. VqGetVarString = 0
  66. VqError = 0
  67. End Function
  68. Function VqPutVarString (Strng$, Handle%, Page&)
  69. 'Support function to store string in variable length
  70. ' VqString array.
  71. '------ Need to append Chr$(0) to end of string.
  72. Strng$ = Strng$ + Chr$(0)
  73. x% = VqVarLenStr(Strng$, Handle%, Page&, VqPutString)
  74. If x% < 0 Then
  75.     VqPutVarString = x%
  76.     VqError = x%
  77.     Exit Function
  78. End If
  79. VqPutVarString = 0
  80. VqError = 0
  81. End Function
  82.